package edu.guet.strategy;

public class CashReturn extends CashSuper {

    private double moneyCondition = 0.0;

    private double moneyReturn = 0.0;

    public CashReturn(double moneyCondition, double moneyReturn) {
        this.moneyCondition = moneyCondition;
        this.moneyReturn = moneyReturn;
    }

    @Override
    public Double acceptCash(Double money) {

        if (money >= moneyCondition){
            money = money - Math.floor(money / moneyCondition) * moneyReturn;
        }
        return money;
    }
}
